package br.edu.infnet.avaliacao.model;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class AvaliacaoQuestaoId implements java.io.Serializable {

	private static final long serialVersionUID = 585498513927115759L;
	private int avaliacaoId;
	private int questaoId;

	public AvaliacaoQuestaoId() {
	}

	public AvaliacaoQuestaoId(int avaliacaoId, int questaoId) {
		this.avaliacaoId = avaliacaoId;
		this.questaoId = questaoId;
	}

	@Column(name = "avaliacao_id", nullable = false)
	public int getAvaliacaoId() {
		return this.avaliacaoId;
	}

	public void setAvaliacaoId(int avaliacaoId) {
		this.avaliacaoId = avaliacaoId;
	}

	@Column(name = "questao_id", nullable = false)
	public int getQuestaoId() {
		return this.questaoId;
	}

	public void setQuestaoId(int questaoId) {
		this.questaoId = questaoId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof AvaliacaoQuestaoId))
			return false;
		AvaliacaoQuestaoId castOther = (AvaliacaoQuestaoId) other;

		return (this.getAvaliacaoId() == castOther.getAvaliacaoId())
				&& (this.getQuestaoId() == castOther.getQuestaoId());
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + this.getAvaliacaoId();
		result = 37 * result + this.getQuestaoId();
		return result;
	}

}
